from lxml import etree

tree = etree.parse("test.html")
# result = tree.xpath("/html/head/a[1]/h5/span/text()") # 找第一个a标签下的内容
# result = tree.xpath("/html/head/a[2]/h5/span[@class='grab-order-orangered']/text()") # 找第一个a标签下的内容
result = tree.xpath("/html/head/a/h5") # 找第一个a标签下的内容
for h5 in result:
    span_name = h5.xpath("./span/text()")
    print(span_name)
